import { createRouter, createWebHashHistory } from 'vue-router'
import Loading from '@/views/Loading.vue'
import Index from '@/views/Index.vue'
import CaseDetail from '@/views/CaseDetail.vue'

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'loading',
      component: Loading
    },
    {
      path: '/index',
      name: 'index',
      component: Index
    },{
      path:'/detail',
      component:CaseDetail
    }
  ],
  scrollBehavior(to, from, savedPosition) {
    // always scroll to top
    return { top: 0 }
  }
})

export default router
